home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / etc / init.d / speech-dispatcher < prev    next >
Text File  |  2009-10-13  |  2KB  |  77 lines

  1. #! /bin/sh
  2.  
  3. ### BEGIN INIT INFO
  4. # Provides:          speech-dispatcher
  5. # Required-Start:    
  6. # Required-Stop:     
  7. # Should-Start:      festival
  8. # Should-Stop:       festival
  9. # Default-Start:     2 3 4 5
  10. # Default-Stop:      1
  11. # Short-Description: Speech Dispatcher
  12. # Description:       Common interface to speech synthesizers
  13. ### END INIT INFO
  14.  
  15. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  16. DAEMON=/usr/bin/speech-dispatcher
  17. PIDFILE=/var/run/speech-dispatcher/speech-dispatcher.pid
  18. NAME=speech-dispatcher
  19. DESC='Speech Dispatcher'
  20. USER=speech-dispatcher
  21.  
  22. [ -r /etc/default/speech-dispatcher ] && . /etc/default/speech-dispatcher
  23.  
  24. . /lib/lsb/init-functions
  25.  
  26. if [ "$RUN_SPEECHD" != "yes" ] && [ "$2" != "spawn" ]; then
  27.     log_warning_msg "Speech-dispatcher configured for user sessions"
  28.     exit 0
  29. fi
  30.  
  31. test -f $DAEMON || exit 0
  32. if ! test -d /var/run/speech-dispatcher ; then
  33.     mkdir -p /var/run/speech-dispatcher
  34.     chown speech-dispatcher.audio /var/run/speech-dispatcher
  35. fi
  36.  
  37. . /lib/lsb/init-functions
  38.  
  39. set -e
  40.  
  41. case "$1" in
  42.   start)
  43.     log_daemon_msg "Starting $DESC" "speech-dispatcher"
  44.     start-stop-daemon --start --quiet --chuid $USER --pidfile $PIDFILE \
  45.           --exec $DAEMON
  46.     log_end_msg $?
  47.     ;;
  48.   stop)
  49.     log_daemon_msg "Stopping $DESC" "speech-dispatcher"
  50.     start-stop-daemon --oknodo --stop --quiet --user $USER \
  51.           --pidfile $PIDFILE --exec $DAEMON
  52.     log_end_msg $?
  53.     ;;
  54.   reload|force-reload)
  55.     log_daemon_msg "Reloading $DESC configuration files" "speech-dispatcher"
  56.     start-stop-daemon --oknodo --stop --signal 1 --quiet --user $USER \
  57.           --pidfile $PIDFILE --exec $DAEMON
  58.         log_end_msg $?
  59.         ;;
  60.   restart)
  61.     log_daemon_msg "Restarting $DESC" "speech-dispatcher"
  62.     start-stop-daemon --oknodo --stop --quiet --user $USER \
  63.           --pidfile $PIDFILE --exec $DAEMON
  64.     sleep 3
  65.     start-stop-daemon --start --quiet --chuid $USER --pidfile $PIDFILE \
  66.           --exec $DAEMON
  67.     log_end_msg $?
  68.     ;;
  69.   *)
  70.     N=/etc/init.d/$NAME
  71.     echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
  72.     exit 1
  73.     ;;
  74. esac
  75.  
  76. exit 0
  77.